package com.ktjy.service.impl;

import com.ktjy.mapper.SysRoleMapper;
import com.ktjy.pojo.SysRole;
import com.ktjy.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class SysRoleServiceImpl implements SysRoleService {
    @Autowired
    SysRoleMapper sysRoleMapper;

    @Override
    public List<SysRole> selectByList() {
        List<SysRole> list = sysRoleMapper.selectByList();
        return list;
    }

    @Override
    public SysRole selectByCode(String code) {
        SysRole sysRole = sysRoleMapper.selectByCode(code);
        return sysRole;
    }

    @Override
    public int insert(SysRole sysRole) {
        int insert = sysRoleMapper.insert(sysRole);
        return insert;
    }

    @Override
    public int update(SysRole sysRole) {
        int update = sysRoleMapper.update(sysRole);
        return update;
    }

    @Override
    public int delete(Integer id) {
        int delete = sysRoleMapper.delete(id);
        return delete;
    }

    @Override
    public SysRole selectById(Integer id) {
        SysRole sysRole = sysRoleMapper.selectById(id);
        return sysRole;
    }
}
